<!-- 
@name: 分享平台
-->
<template>
	<div id="share" class="page">
		<img class="shareImg" object-fit="fill" :src="dataList.shareRegisterPhoto" @click="jump"></img>
		<!-- <div class="flex-row flex-center">
			<van-button type="info" class="button2" @click="share">立即注册<van-icon name="arrow" /></van-button>

		</div> -->
	</div>
</template>
<script>
export default {
	name: 'app',
	components: {},
	data() {
		return {
			dataList: {},
		};
	},

	created() {
		this.getData();
	},
	methods: {
        jump(){
            this.$router.push({path:'/',query:{pkey:this.$route.query.pkey}})
        },
		getData() {
			var params = {};
			this.$myApi['getConfig_index'](params).then((res) => {
				if (res.code == 0) {
					this.dataList = res.result;
				} else {
				}
			});
		},
		share() {
		var link =
				this.$store.state.shareUrl+'share/shareRegister?pkey=' +
				this.$store.state.userinfo.pkey;
			var dataList = {
				title: 'WaWa搭子', // 分享标题
				// desc: dataList.summary, // 分享描述
				// imgUrl: dataList.photo, // 分享图标
			};
			this.updateAppMessageShareData(dataList, link);
		},
		goHandle() {
			this.$router.push({
				path: '/BankingBusiness/handle',
				query: { item: JSON.stringify(this.dataList) },
			});
		},
		goDetail(pkey) {
			// console.log()
			this.$router.push({
				path: '/BankingBusiness/share',
				query: { pkey: pkey },
			});
		},
		sortChange(pkey) {
			this.searchData.sortType = pkey;
			this.clearSearch();
			this.finished = true;
			this.getData(true);
		},
		onLoad() {
			console.log('触底');
			this.getData();
		},
		onClick() {
			this.clearSearch();
			this.finished = true;
			this.getData(true);
		},
		getGtype_goods() {
			this.$myApi.getGtype_goods().then((res) => {
				if (res.code == 0) {
					var arr = [{ name: '全部', pkey: '' }, ...res.result];
					this.getGtypeList = arr;
				} else {
				}
			});
		},

		clearSearch() {
			this.likeList = [];
			this.searchData.page = 0;
			this.searchData.pagesize = 5;
			this.finished = false;
		},
		onSearch(e) {
			console.log(e);
			this.clearSearch();
			this.searchData.title = e;
			this.finished = true;
			this.getData(true);
		},
		onCancel() {},
	},
};
</script>
<style lang="less" scoped>
#share {
	padding-left: 0rem;
	padding-right: 0rem;
	min-height: 100vh;
	background-color: #fafafa;
	padding-bottom: 0;
	height: 100vh;
	overflow: hidden;
	.button1 {
		border: none;
		background: #3d84ff;
		border-top-left-radius: 30px;
		border-bottom-left-radius: 30px;
		width: 40%;
		margin: 0.4rem 0;
		font-size: 0.32rem;
		padding: 0.3rem 0;
		height: auto;
	}
	.button2 {
		font-size: 0.32rem;
		margin: 0.4rem 0;
		width: 80%;
		border: none;
		background: #ffce17;
		color: #000;
		padding: 0.3rem 0;
		height: auto;
		border-radius: 30px;
	}
	.shareImg {
		width: 100%;
		height: 100vh;
		// height: auto;
	}
}
</style>
<style lang="less" scoped>
/deep/.van-search .van-cell {
	padding-top: 0.2rem;
	padding-bottom: 0.2rem;
	font-size: 0.28rem;
}
/deep/.van-tab {
	// flex: 0 1 auto;
	// width: 1rem;
	font-size: 0.3rem;
}
/deep/.van-tab--active {
	font-weight: bold;
	font-size: 0.32rem;
}
</style>